﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Server.Manager
{
    abstract class BaseModule : IDisposable
    {
        static int LastModuleId = 0;

        public readonly int ModuleId;

        protected BaseModule()
        {
            ModuleId = LastModuleId++;
        }

        //做标记
        protected void Load()
        {
            Console.WriteLine($"{this.GetType().Name} 被加载！");
        }
        //和Dispose结合
        public virtual void Init()
        {
            Console.WriteLine($"{this.GetType().Name} 初始化！");
        }
        //和Stop结合
        public virtual void Start()
        {
            Console.WriteLine($"{this.GetType().Name} 启动！");
        }

        public virtual void Update()
        {

        }

        public virtual void Stop()
        {
            Console.WriteLine($"{this.GetType().Name} 终止！");
        }

        public virtual void Dispose()
        {
            Console.WriteLine($"{this.GetType().Name} 释放！");
        }
        //移除标记
        protected void Unload()
        {

        }

    }
}
